<?php if(!in_array($data, array(null, '', '0'))):?>

<script type="text/javascript">
    setTimeout(function(){
        jQuery(".chzn-select").chosen();
    },1);
</script>
		  <?php $attr = array('class' => 'stdform','id' => 'form-list'); echo form_open($baseurl.'manage/campaign/add-user-code', $attr);?>
        <input name="id" type="hidden" value="<?php echo $data['id'];?>" />
        <p>
        	<label>Mã Code quà tặng</label>
            <span class="field" style="padding-top: 5px;font-size: 18px;font-weight: bold;">
                <?php echo $data['code_user'];?>
                <input name="code_user" type="hidden" value="<?php echo $data['code_user'];?>" />
            </span>
        </p>
		<p>
        	<label>Khách hàng</label>
            <span class="field" style="padding-top: 5px;">
                <?php echo $data['fullname'] ? $data['fullname'] : $data['username'];?>
                <input name="user" type="hidden" value="<?php echo $data['user_id'];?>" />
            </span>
        </p>
        <!-- -->
		<p>
			<label>Tên nhà hàng ( * )</label>
            <span class="field">
				<select name="restaurant_id">
					<?php echo $listRestaurant;?>
				</select>
			</span>
		</p>
		
		<p>
			<label>Ca làm việc ( * )</label>
            <span class="field">
			<input name="log_work_car" type="text" class="input-xlarge" value="" placeholder="Ca làm việc..." />
			</span>
		</p>
		
		<p>
			<label>Số bill ( * )</label>
            <span class="field">
			<input name="log_bills" type="text" class="input-xlarge" value="" placeholder="Số bill..." />
			</span>
		</p>
		
		<p>
			<label>Số khách ( * )</label>
            <span class="field">
			<input name="log_customers" type="text" class="input-xlarge" value="" placeholder="Số khách..." />
			</span>
		</p>
		
		<p>
			<label>Doanh thu ( * )</label>
            <span class="field">
			<input name="log_revenue" type="text" class="input-xlarge" value="" placeholder="Doanh thu..." />
			</span>
		</p>
		
		<p>
			<label>Tên khách hàng ( * )</label>
            <span class="field">
			<input name="log_customer" type="text" class="input-xlarge" value="" placeholder="Tên khách hàng..." />
			</span>
		</p>
		
		<p>
			<label>Số điện thoại ( * )</label>
            <span class="field">
			<input name="log_mobile" type="text" class="input-xlarge" value="" placeholder="Số điện thoại..." />
			</span>
		</p>
		
		<p>
			<label>Quà tặng ( * )</label>
            <span class="field">
			<input name="log_gift" type="text" class="input-xlarge" value="" placeholder="Quà tặng..." />
			</span>
		</p>
		
		<p>
        	<label>Xác nhận đã nhận quà tặng ( * )</label>
            <span class="field">
			<select name="active">
				<option value="1">Đã nhận quà tặng</option>
			</select>
            </span>
        </p>
		<!-- -->
		
        <p>
            <label></label>
            <button class="btn btn-rounded" type="submit"> <i class="iconfa-ok"></i> &nbsp; Lưu</button>
        </p>
		</form>
<?php else:?>
<?php die('404');?>
<?php endif;?>


<script>


$(function()
{   
    if($('#x2').is(':checked'))
    {
        $('#time_select_box').show();
    }else{
        $('#time_select_box').hide();
    }
    $('input[type=radio][name=incentives_type]').change(function()
    {
        var type = this.value;
        
        if(type == 1){
            $('#time_select_box').fadeIn('slow');    
        }else{
            $('#time_select_box').fadeOut('slow');
        }
    });
    if($('#r2').is(':checked'))
    {
        $('#restaurant_select_box').show();
    }else{
        $('#restaurant_select_box').hide();
    }
    $('input[type=radio][name=restaurant_target]').change(function()
    {
        var r_type = this.value;
        
        if(r_type == 1){
            $('#restaurant_select_box').fadeIn('slow');
        }else{
            $('#restaurant_select_box').fadeOut('slow');
        }
    });
});



</script>